<template>
  <div id="userLayout">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="header">
        <a-space class="header-content" align="center">
          <img class="logo" src="../assets/logo.svg" alt="logo" />
          <div class="title">Linux OJ</div>
        </a-space>
      </a-layout-header>

      <a-layout-content class="content">
        <router-view />
      </a-layout-content>

      <a-layout-footer class="footer">
        <div class="footer-content">
          <img src="../assets/logo.svg" alt="beian" width="35" height="35" />
          <span>Linux操作系统与应用作业提交系统</span>
        </div>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<style scoped>
#userLayout {
  text-align: center;
}

/* Header 区域优化 */
.header {
  margin: 16px 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo {
  width: 64px;
  height: 64px;
  vertical-align: middle;
}

.title {
  font-size: 1.5em;
  font-weight: 500;
}

/* Content 区域 */
.content {
  background: ghostwhite;
  margin-bottom: 16px;
  padding: 20px;
  min-height: calc(100vh - 200px); /* 保持内容区域高度 */
}

/* Footer 优化 */
.footer {
  background: #efefef;
  padding: 16px;
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
}

.footer-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 8px;
  }

  .footer-content span {
    font-size: 0.9em;
  }

  .logo {
    width: 48px;
    height: 48px;
  }
}
</style>

<script setup lang="ts"></script>
